﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WickedFlame.VecDraw.Base.Controls">
    
    <Style TargetType="{x:Type local:ImageButton}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ImageButton}">
                    <Border 
                        Name="btnBorder"
                        Background="{TemplateBinding Background}"
                        CornerRadius="2"
                        BorderThickness="1"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        >

                        <ContentPresenter x:Name="Icon" 
                                          VerticalAlignment="Center"
                                          ContentSource="Icon"
                                          HorizontalAlignment="Center"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>

                    </Border>

                    <ControlTemplate.Triggers>

                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="BorderBrush" Value="#FF565656" TargetName="btnBorder" />
                        </Trigger>
                        
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5"/>
                        </Trigger>
                        
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>